package com.wzcl.app.controller;

import com.wzcl.app.model.common.RVO;
import com.wzcl.app.model.dto.TestPaperDownloadDto;
import com.wzcl.app.service.TestPaperDownloadService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;

/**
 * @author beingven
 * @Description TODO
 * @createTime 2021年01月10日 10:03:00
 */
@RestController
@RequestMapping("/paper")
@Api(value = "试卷下载controller", tags = {"试卷下载相关接口"})
public class TestPaperDownloadController {
    @Resource
    private TestPaperDownloadService testPaperDownloadService;

    @ApiOperation("创建题目大纲")
    @PostMapping("/create/download")
    public RVO createDownloadRecord(@RequestBody TestPaperDownloadDto testPaperDownloadDto){
        return RVO.success(testPaperDownloadService.createDownloadRecord(testPaperDownloadDto));
    }

    @ApiOperation("根据条件查询试卷下载数据并分页")
    @PostMapping("/retrieve/condition")
    public RVO retrieveByCondition(@RequestBody TestPaperDownloadDto testPaperDownloadDto){
        return RVO.success(testPaperDownloadService.retrieveByCondition(testPaperDownloadDto));
    }
}